import { Empty, FormInstance } from 'antd'
export const searchConfig = ({
  SupplierOption,
  handleSearchSupplier,
  ProDevSeason,
}: {
  SupplierOption: IOptionItem[]
  ProDevSeason: IOptionItem[]
  handleSearchSupplier: (newVal: string) => void
  form: FormInstance
}): IItemArray[] => {
  return [
    {
      name: 'seasonId',
      label: '开发季',
      type: 'Select',
      option: ProDevSeason,
      placeholder: '请选择开发季',
      config: {
        showSearch: true,
        optionFilterProp: 'label',
      },
    },
    {
      name: 'querySupplierIdList',
      label: '供应商',
      type: 'Select',
      option: SupplierOption,
      config: {
        mode: 'multiple',
        maxTagCount: 'responsive',
        suffixIcon: null,
        showSearch: true,
        optionFilterProp: 'label',
        filterOption: false,
        onSearch: handleSearchSupplier,
        notFoundContent: <Empty description="请输入内容搜索" image={Empty.PRESENTED_IMAGE_SIMPLE} />,
      },
    },
    {
      label: '面料编码',
      name: 'fabricCodes',
      placeholder: '多个编码间需要换行或使用","分隔',
      type: 'Select',
      config: {
        mode: 'tags',
        maxTagCount: 'responsive',
        tokenSeparators: [',', '，', '\n', '\r', '\r\n'],
        notFoundContent: null,
      },
    },
    {
      label: '创建时间',
      name: 'createTimeStart',
      type: 'FixedRangePicker',
      config: { showTime: true, customFormat: 'YYYY-MM-DD HH:mm:ss' },
    },
    {
      name: 'fabricTypeCode',
      label: '面种编码',
      type: 'Input',
      placeholder: '请输入面种编码',
    },
  ]
}
